@(articleForm : Form[_])(implicit lang:Lang,flash:Flash,request:Request[_])

@import play.api.cache._
@import util._
@import play.api.Play.current

@moreScript = { <script src="@routes.Assets.at("javascripts/epiceditor.min.js")"></script> 
                <script type="text/javascript">
				 var opts = {
				  container: 'epiceditor',
				  textarea: "content",
				  basePath: '',
				  clientSideStorage: true,
				  localStorageName: 'epiceditor',
				  file: {
				    name: 'epiceditor',
				    autoSave: 100
				  },
				  theme: {
				    base: '@routes.Assets.at("stylesheets/epiceditor.css")',
				    preview: '@routes.Assets.at("stylesheets/github.css")',
				    editor: '@routes.Assets.at("stylesheets/epic-dark.css")'
				  },
				  focusOnLoad: false,
				  string: {
				    togglePreview: '@Messages("article.new.togglePreview")',
				    toggleEdit: '@Messages("article.new.toggleEdit")',
				    toggleFullscreen: '@Messages("article.new.toggleFullscreen")'
				  },
				  autogrow: true,
				  autogrow:{
				    minHeight:150
				  }
				}
				var editor = new EpicEditor(opts).load();
				
				$(".tagsinput").tagsInput();
   			</script>
            }
@main(Messages("article.new.blog"),moreScript){
  <div class="row">
    <div class="col-md-9">
      <form method="post" action="@routes.Blogs.save">
             @articleForm.errors.map { error =>
	      	 <div class="form-group has-error">
           		 <input class="form-control" type="text" value="@error.message">
         	 </div>
      		}
        <input type="hidden" id="id" name="id" value="@articleForm.data.getOrElse("id", -1)"/>
        <input type="text" id="title" name="title" class="form-control input-lg" style="width:40%" placeholder="@Messages("article.new.title")" 
        value="@articleForm.data.getOrElse("title", "")"
        />
        <hr/>
        <input name="tags" id="tags" class="tagsinput" value="" 
        value="@articleForm.data.getOrElse("tags", "")"/>
        <hr/>
        <textarea id="content" name="content" style="display:none">
          @articleForm.data.getOrElse("content", "")
        </textarea>
        <div id="epiceditor"></div>
        <hr/>
        <button class="btn btn-primary btn-wide" type="submit">
             @Messages("article.new.post")
        </button>
      </form>
    </div>
    <div class="col-md-3">
      @right()
    </div>
  </div>
}

